import { ref } from 'vue'

export default function useVisible() {
  const visible = ref(false)
  const activeKey = ref('1')
  const show = (key?: string) => {
    visible.value = true
    if (key) {
      activeKey.value = key
    }
  }
  const hide = () => {
    visible.value = false
  }
  return {
    visible,
    activeKey,
    show,
    hide
  }
}
